// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Cluster;

public sealed partial class DeleteVotingConfigExclusionsRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// Specifies whether to wait for all excluded nodes to be removed from the
	/// cluster before clearing the voting configuration exclusions list.
	/// Defaults to true, meaning that all excluded nodes must be removed from
	/// the cluster before this API takes any action. If set to false then the
	/// voting configuration exclusions list is cleared even if some excluded
	/// nodes are still in the cluster.
	/// </para>
	/// </summary>
	public bool? WaitForRemoval { get => Q<bool?>("wait_for_removal"); set => Q("wait_for_removal", value); }
}

/// <summary>
/// <para>
/// Clears cluster voting config exclusions.
/// </para>
/// </summary>
public sealed partial class DeleteVotingConfigExclusionsRequest : PlainRequest<DeleteVotingConfigExclusionsRequestParameters>
{
	internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteVotingConfigExclusions;

	protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;

	internal override bool SupportsBody => false;

	internal override string OperationName => "cluster.delete_voting_config_exclusions";

	/// <summary>
	/// <para>
	/// Specifies whether to wait for all excluded nodes to be removed from the
	/// cluster before clearing the voting configuration exclusions list.
	/// Defaults to true, meaning that all excluded nodes must be removed from
	/// the cluster before this API takes any action. If set to false then the
	/// voting configuration exclusions list is cleared even if some excluded
	/// nodes are still in the cluster.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public bool? WaitForRemoval { get => Q<bool?>("wait_for_removal"); set => Q("wait_for_removal", value); }
}

/// <summary>
/// <para>
/// Clears cluster voting config exclusions.
/// </para>
/// </summary>
public sealed partial class DeleteVotingConfigExclusionsRequestDescriptor : RequestDescriptor<DeleteVotingConfigExclusionsRequestDescriptor, DeleteVotingConfigExclusionsRequestParameters>
{
	internal DeleteVotingConfigExclusionsRequestDescriptor(Action<DeleteVotingConfigExclusionsRequestDescriptor> configure) => configure.Invoke(this);

	public DeleteVotingConfigExclusionsRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteVotingConfigExclusions;

	protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;

	internal override bool SupportsBody => false;

	internal override string OperationName => "cluster.delete_voting_config_exclusions";

	public DeleteVotingConfigExclusionsRequestDescriptor WaitForRemoval(bool? waitForRemoval = true) => Qs("wait_for_removal", waitForRemoval);

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}